<h1>Listing proposals</h1>

<table>
  <tr>
    <th>Title</th>
    <th>Description</th>
  </tr>

<% @proposals.each do |proposal| %>
  <tr>
    <td><%=h proposal.title %></td>
    <td><%=h proposal.description %></td>
	
	<td><% proposal.documents.each do |document| %>
		<p><%=h document.comment %></p>   
	<% end %></td>
    <td><%= link_to 'Show', proposal %></td>
    <td><%= link_to 'Edit', edit_proposal_path(proposal) %></td>
    <td><%= link_to 'Destroy', proposal, :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New proposal', new_proposal_path %>